package com.whfc.emp.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whfc.common.exception.BizException;
import com.whfc.common.result.PageData;
import com.whfc.common.util.PageUtil;
import com.whfc.emp.dao.AppTrainingBannerMapper;
import com.whfc.emp.dto.AppTrainingBannerDTO;
import com.whfc.emp.dto.AppTrainingCategoryDTO;
import com.whfc.emp.dto.AppTrainingDTO;
import com.whfc.emp.entity.AppTraining;
import com.whfc.emp.param.AppTrainingAddParam;
import com.whfc.emp.param.AppTrainingBannerListParam;
import com.whfc.emp.param.AppTrainingEditParam;
import com.whfc.emp.param.AppTrainingListParam;
import com.whfc.emp.service.AppTrainingCategoriesService;
import com.whfc.emp.service.AppTrainingBannerService;
import com.whfc.fuum.service.SysDeptService;
import com.whfc.fuum.service.SysDictService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * @ClasssName AppTrainServiceImpl
 * @Description 人员管理-banner
 * @Author hw
 * @Date 2020/11/26 16:18
 * @Version 1.0
 */
@DubboService(interfaceClass = AppTrainingBannerService.class, version = "1.0.0", timeout = 5000)
public class AppTrainingBannerServiceImpl implements AppTrainingBannerService {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private AppTrainingBannerMapper appTrainingBannerMapper;

    @Override
    public PageData<AppTrainingBannerDTO> list(AppTrainingBannerListParam request) throws BizException {
        PageHelper.startPage(request.getPageNum(), request.getPageSize());
        List<AppTrainingBannerDTO> list = appTrainingBannerMapper.selectByParam(request);
        PageHelper.clearPage();
        return PageUtil.pageData(PageInfo.of(list));
    }

    @Override
    public void add(AppTrainingAddParam request) throws BizException {

    }

    @Override
    public void edit(AppTrainingEditParam request) throws BizException {

    }

    @Override
    public void del(Integer id) throws BizException {

    }

    @Override
    public List<AppTrainingBannerDTO> getTrainingBannerList() {
        return  appTrainingBannerMapper.listAll();
    }


}
